#include<bits/stdc++.h>
using namespace std;
int main()
{
	int a,b,c,d,sum,num;
	cin>>a>>b>>c>>d;
	sum=c*10+d;
	num=a*10+b;
	cout<<sum/num<<" "<<sum%num; 
	return 0;
}
